package com.example.rrr_map;

import com.example.rrr_map.Util.Global;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class OpponentActivity extends Activity {

	private static TextView tvOpponentID;
	private static TextView tvFightingText;
	private static Button buttonYes;
	private static Button buttonNo;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_opponent);
		
		tvOpponentID = (TextView) findViewById(R.id.opponentid);
		tvFightingText = (TextView) findViewById(R.id.fightingtext);
		tvOpponentID.setText(Global.getOpponentID());
		tvFightingText.setText("Do you want to fight " + Global.getOpponentID() + "?");
		
		
		buttonYes = (Button) findViewById(R.id.buttonyes);
		buttonYes.setOnClickListener(yesClickListener);
		buttonNo = (Button) findViewById(R.id.buttonno);
		buttonNo.setOnClickListener(noClickListener);
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.opponent, menu);
		return true;
	}
	
	
	protected OnClickListener yesClickListener = new OnClickListener()
    {
		@Override
		public void onClick(View v) {
			
			Intent intent = new Intent(getApplicationContext(), WeaponsActivity.class);
			startActivity(intent);
		}
    };
    
    protected OnClickListener noClickListener = new OnClickListener()
    {
		@Override
		public void onClick(View v) {
			
			Intent intent = new Intent(getApplicationContext(), WarriorsActivity.class);
			startActivity(intent);
		}
    };
    
    

}
